package com.huawei.hianalytics.ab.bc.ab;

import com.huawei.hms.framework.network.restclient.hwhttp.dns.DnsConfig;
import java.nio.charset.Charset;

public final class bc {
    public static final Charset ab = Charset.forName("UTF-8");
    private static bc bc;
    private fg cd;

    public enum ab {
        AES(16),
        RSA(DnsConfig.MAX_CACHE_ENTRIES),
        HMCSHA256(16),
        OTHER(0);
        
        private int ef;

        private ab(int i) {
            this.ef = i;
        }

        public int ab() {
            return this.ef;
        }
    }

    private bc() {
    }

    public static bc ab() {
        if (bc == null) {
            bc();
        }
        return bc;
    }

    private static synchronized void bc() {
        synchronized (bc.class) {
            if (bc == null) {
                bc = new bc();
            }
        }
    }

    public fg ab(ab abVar) {
        switch (abVar) {
            case AES:
                this.cd = new ab();
                break;
            case HMCSHA256:
                this.cd = new ef();
                break;
            case RSA:
                this.cd = new gh();
                break;
            default:
                com.huawei.hianalytics.ab.bc.ef.ab.bc("CryptFactory", "crypt type is other");
                break;
        }
        return this.cd;
    }

    public String ab(String str) {
        return cd.ab(str);
    }

    public String ab(char[] cArr, byte[] bArr) {
        return cd.ab(cArr, bArr);
    }

    public String bc(ab abVar) {
        return de.ab(abVar.ab());
    }

    public byte[] bc(String str) {
        return de.ab(str);
    }
}
